package org.bear.bundle.framework.controller;

import java.util.Map;

import org.bear.bundle.framework.JMSProducer;

import it.sauronsoftware.cron4j.Task;
import it.sauronsoftware.cron4j.TaskExecutionContext;

public class PluginTask extends Task {

	// MQ连接url
	private String brokerUrl;
	// MQ用户名
	private String username;
	// MQ密码
	private String password;
	// 插件回送信息
	private Map<String, Object> pluginMap;

	public PluginTask(String brokerUrl, String username, String password,
			Map<String, Object> pluginMap) {
		this.brokerUrl = brokerUrl;
		this.username = username;
		this.password = password;
		this.pluginMap = pluginMap;
	}

	@Override
	public void execute(TaskExecutionContext arg0) throws RuntimeException {
		JMSProducer jmsProducer = new JMSProducer(brokerUrl, username, password);
		jmsProducer.send("PLUGIN.STATUE.CENTER", pluginMap, null);
	}

}
